package day2.cases.traittest

/**
  * Created by Administrator on 2017/6/8.
  */
trait Logger {

  def log(message:String) = println(message)

}
class Person(val name:String) extends Logger{
  def makeFridends(p:Person): Unit ={
    println("I'm"+name+" i'm glade to make friends with you"+p.name);
    log("makeFridends method invoked!!")
  }
}

object  testLogger{
  def main(args: Array[String]) {
    val p1=new Person("linpingzhi")

    val p2=new Person("yuelingshan");
    p1.makeFridends(p2)
  }
}
